#ifndef DRAWWIDGET_H
#define DRAWWIDGET_H

#include <QWidget>
#include<QtGui>
#include<QMouseEvent>//鼠标事件
#include<QPaintEvent>//绘制事件
#include<QResizeEvent>//实时获得窗口大小事件
#include<QColor>
#include<QPixmap>//显示图像
#include<QPainter>
#include<QPalette>
#include<QPen>

class DrawWidget : public QWidget
{
    Q_OBJECT
public:
    explicit DrawWidget(QWidget *parent = nullptr);
public slots:
    void getColor1(QColor);
    void getfontType(int fontType);
    void getFontWidth(int fontw);
    void ClearAll();

protected:
    void resizeEvent(QResizeEvent *event);
    void mouseMoveEvent(QMouseEvent *event);
    void mousePressEvent(QMouseEvent *event);
    void paintEvent(QPaintEvent *event);

private:
    QPixmap *pix;
    QColor color;
    QPoint startpos;
    QPoint endpos;
    int fontType1;
    int fontw1;

signals:

};

#endif // DRAWWIDGET_H
